AAA user database import

I want to import the 1500 users in ACS. i am using cli utilities (CSUtil.exe). I am able to import the user, but I dont know which options to be used for populating the following user info
1) User Expiry date
2) Apply shared profile
etc.
Can somebody help me in that?

User Expiry is possible via RDBMS sync,
http://www.cisco.com/en/US/docs/net_mgmt/cisco_secure_access_control_server_for_windows/4.1/user/A_RDBMS.html#wp92082
Action Code : 113
SET_PASS_EXPIRY_DATE
UN,V1
Sets the date on which the account expires. The date format should be YYYYMMDD.
For shared profile comp ,I don't thinks there is any option.
Regards,
~JG
Do rate helpful posts

Similar Messages

  • Import all users and their objects without doing full database import

    Hi Guys,
    I have a task to that involves Importing all existing users and their objects in production to the test database without doing a full database import - Please how do i do this?
    Pls i need your help urgently.

    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    I tried to import objects and data from a user from a FULL dump file. File was created with the following command:
    server is: SQL*Plus: Release 10.2.0.1.0 - Production on Wed May 26 15:34:05 2010
    exp full=y FILE="full.dmp" log=full.log
    Now I imported:
    imp file=full.dmp log=full.log INCTYPE=SYSTEM
    imp fromuser=user1 file=full.dmp
    Results: not all the user procedures have been imported:
    SQL> select count(*) from user_procedures;
    the Original
    COUNT(*)
    134
    the current:
    select count(*) from user_procedures;
    COUNT(*)
    18
    I also tried these alternatives:
    exp tablespaces="user1_data" FILE="user1.dmp" log=user1.log
    exp LOG=user1.log TABLESPACES=user1_data FILE=user1_data.dmp
    exp LOG=user1owner.log owner=user1 FILE=user1owner.dmp
    expdp DIRECTORY=dpump_dir1 dumpfile=servdata_pump version=compatible SCHEMAS=user1
    impdp directory=data_pump_dir dumpfile=servdata_pump.dmp :
    ORA-39213: Metadata processing is not available
    SQL> execute dbms_metadata_util.load_stylesheets
    BEGIN dbms_metadata_util.load_stylesheets; END;
    ERROR at line 1:
    ORA-31609: error loading file "kualter.xsl" from file system directory
    "/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/rdbms/xml/xsl"
    ORA-06512: at "SYS.DBMS_METADATA_UTIL", line 1793
    ORA-06512: at line 1
    file kualter.xsl does not exist in XE !!
    imp owner=user1 rows=n ignore=y
    imp full=y file=user1_data.dmp
    imp full=y file=full.dmp tablespaces=user1_data,user1_index rows=n ignore=y
    So, I do not understand why user1 objects are not imported:
    see this part of the first import log:
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in US7ASCII character set and AL16UTF16 NCHAR character set
    import server uses WE8ISO8859P1 character set (possible charset conversion)
    . importing SYS's objects into SYS
    . importing USER1's objects into USER1
    . . importing table .........................
    why only 18 rows?
    if you have an suggestion, you are welcome, as I do not have any other idea...
    ren
    Edited by: ronpetitpatapon on May 26, 2010 12:38 PM
    Edited by: ronpetitpatapon on May 26, 2010 12:41 PM
    Edited by: ronpetitpatapon on May 26, 2010 1:03 PM

  • ACS User Database Export

    Is it possible to export the user database stored in the Cisco Secure ACS Database to some file. I need to see all the user accounts and their group assignments etc to be able to do reporting on this.
    Any ideas?

    yes... csutil -d will dump the db.
    look at aaa-reports (www.extraxi.com) they can import the dump file and run reports off it.

  • Allow user to import excel file without using wizard ?

    Hi !
    How can i realize an application where the user can import an excel sheet. The user should just choose the file to import and all the other things should happen automatically. The files are allways equal, allways same colums, allways same delimiters and the destination table is allways the same, too.
    With other words : how to build an own import wizard ?
    I know that i can easily upload a csv file to the database. But how can i get access to the uploaded file from sql or pl/sql ? If this would work, i could make simple selects and insert them into the destination.
    Perhaps someone can help me.
    Greetings
    Bernd

    Bernd,
    You're on the right track. For now, you'll have to write your own parsing routine and do your own inserts. If you follow the how to on uploading files, you can then simply take the blob and parse through it in pl/sql.
    Sergio

  • How can I share a Tiger server's User database to a Panther server?

    I need some help to set this up. Keep in mind I do not have a DNS server.
    I have a Tiger server with Xserve and an older Panther server, both on the same local network. I have a whole bunch of users setup on the Tiger server. The Panther server does not have any users setup on it. I do not want to have to type in all the users all over again in the Panther server. What I'd like to be able to do is somehow share and syncronize the user database on the Tiger server with the Panther server.
    I looked into the Open Directory settings but I do not understand what to do. How do I configure the Tiger and Panther servers respectively so the Panther server can sync with the Tiger server's users database. Is this possible? It seems like it with Open Directory, one being the Open Directory Master and the other being the Open Directory Replica? But I just don't understand how to set this up. Also the Panther OD settings seem quite different than Tiger's in Open Directory.
    Any help would be appreciated.
    Message was edited by: robocub1

    Hi
    It may be best to set up your 10.4 Server as an Open Directory Master first and then use Directory Access on your 10.3 Server to connect to the Tiger Server so as it can use the same User Database. This should be possible. OD Master/Replica relationships are not possible if the OS versions are different, even if the Master was 10.4.11 and the Replica was 10.4.10. You have no chance when its 10.4 and 10.3.
    http://images.apple.com/server/macosx/docs/OpenDirectory_Adminv10.5.pdf
    The link is for 10.5 but the basics are the same. This is a recent post that describes how to set up an OD Master:
    http://discussions.apple.com/thread.jspa?threadID=1377046&tstart=0
    I'm guessing that your 10.4 Server is Standalone and is serving simple file services only (AFP and possibly SMB/Windows). If this is the case (and I can't see how it can't be) then your users will be in the local NetInfo node. This will be the default node that is presented to you in WorkGroup Manager. You always get a warning that your are working in an invisible node (if you have not disabled this) when working in the Server's local node. Don't worry there is nothing wrong with the warning. WorkGroup Manager on Panther (10.3) Server works the same way.
    You could if you wanted to simply export the Users and Groups from WGM in 10.4 and import them into WGM on 10.3. This should save you having to key them all in again. If the prospect of configuring internal DNS Services and all that goes with it seems to much for you then this is probably the simplest option. How do you do this? Launch WGM (its the same for both versions), select the Server Menu and select Export after first selecting desired users. Do the same for Groups. Use the same procedure in reverse. The Users and Groups files are not very big and can easily be transferred using a memory stick etc.
    There are differences between the two versions which are mostly to do with Server Admin. In 10.4 Server there are more services. One of the Services will be Open Directory. In 10.4 Open Directory will only show a green light by the side of the service if it is in any role other than Standalone. Server Admin on 10.3 Server will always show the green light by the side of the Open Directory Service. This does not mean that it is an OD Master, you have to click on Settings and inspect the Role to see what it actually is.
    You should be able to connect to a 10.3 Server with 10.4's Admin tools but don't be tempted to use Server Admin to configure/change anything on the 10.3 Server. You should not be able to go the other way 10.3 > 10.4 using the same tools.
    Internal DNS Services are a requirement for LDAP Services (and pretty much everything else) on Servers generally, although for simple file services not absolutely necessary. Internal DNS Services do not have to be configured on the Server itself just as long as they are configured on another server, for example, on the same network. If these are the only two servers on the network then you will have to configure DNS Services on either one or both of them depending on what you want.
    Not available on your 10.3 Server but is on your 10.4 Server are Access Control Lists (ACLs). This is a permissions model that is in addition to the standard POSIX permissions. Think carefully about how you provide permissions to your network clients if there is a mix of client OS, 10.3, 10.4 etc.
    Hope this helps, Tony

  • Error in R3load in Database Import

    Hello,
    I am installing 3.1I system on Aix 5.3 and Oracle 9.2.0.7. I am getting below error in my database import.
    ***********************************************************************************************DbSl Trace: Connect with default <uid>/<pwd> failed
    DbSl Trace: Try to connect as OPS$-user to get the <uid>/<pwd>
    DbSl Trace: CONNECT failed with sql error '1017'
    #(IMP) ERROR: couldn't connect to DB
    rc = 256
    error message returned by DbSl:
    #STOP: 20070524184058
    #(IMP) ERROR: DbSlRollback failed
    DbSlRollback: rc = 1
    (SQL error 1017)
    #START OF LOG: 20070525091803
    R3load version @(#)R3load.c       20.29.121.1     SAP     00/07/07
    R3load -i  EX000.cmd -p EX000.log -r
    Regards,
    Bhushan

    Hello,
    do the OPS$ User exist? Do they have the right permissions? To which user does the table SAPUSER belong? Can you connect with sap<xyz) or SAPR3 to database?
    e.g. like
    sqlplus /nolog
    connect sap<xyz>/pw?
    you should change the password for the sap database user with brtools, like
    brconnect -f chpass -o [sapr3 | sap<sid> | sap<xyz> | sapsr3] -p <new_password>
    Best regards
    K.Baran

  • [Q] ORA-30510 error while doing full database import

    We have ORACLE 9.2.0.6 on Redhat LINUX AS 3.4. while we doing "full database import" there has ORA-30510 come out. I searched Metalink and Google, but not found much information. The error messages on import are:
    . importing OUTLN's objects into OUTLN
    . importing SYSTEM's objects into SYSTEM
    . importing TKOWNER's objects into TKOWNER
    IMP-00017: following statement failed with ORACLE error 30510:
    "CREATE TRIGGER "TKOWNER".TRIG_DONOTANALYZE before analyze on schema decla"
    "re begin if sys.dictionary_obj_name = 'MYWTKEMPLOYEE' then raise_ap"
    "plication_error(-20101, 'Do Not ANALYZE MYWTKEMPLOYEE'); end if; end; "
    IMP-00003: ORACLE error 30510 encountered
    ORA-30510: system triggers cannot be defined on the schema of SYS user
    . importing SYS's objects into SYS
    . importing TKOWNER's objects into TKOWNER
    About to enable constraints...
    Import terminated successfully with warnings.

    877410 wrote:
    Hi I get the following ierrors while importing a schema from prod to dev database... can anyone help ,thanks!
    impdp system DIRECTORY=DATA_PUMP_DIR DUMPFILE=abcdprod.DMP LOGFILE=abcdprod.log REMAP_SCHEMA=abcdprod:abcddev
    ORA-39002: invalid operation
    ORA-31694: master table "SYSTEM"."SYS_IMPORT_FULL_01" failed to load/unload
    ORA-31644: unable to position to block number 170452 in dump file "/ots/oracle/echo/wxyz/datapump/abcdprod.DMPpost complete command line for the expdp that made the abcdprod.DMP file

  • Export UB10 user database

    I thought both MS and UB databases were combined, but when I brought by user database in my merge database, the UB footprints didn't follow.
    I've gone through the great pains of rebuilding my UB database and I want to properly export it like MS does. How is this done??????????
    Why isn't there an export option? Anyone?Message Edited by kittmaster on 07-20-2007 11:29 AM
    Signature: Looking for a footprint, component, model? Might be here > http://ni.kittmaster.com

    At this point all of my databases are rebuilt in ver 10 as the were in version 9.
    So, example. I've created the LM3914 with its spice model in MS10, it also has a footprint that is linked to UB.
    Now, if I export the MS database as a prz file, the UB footprint data.....is it there?
    In version 9 when this setup was exactly as described above for version 10, when I exported the V9 database, it only save the MS data!!
    I know this because when I tried to import my V9 database into V10, its said invalid format. And of course there is NOTHING in the help file to tell you how to handle this error.....basically if your screwed if you have no intitive to comb through forum (which is how I found my partial solution) to use the "convert database" function which then took the V9 database and converted it to V10. The only data that was imported was the MS data/spice info. The UB9 footprint data never came in.
    I had to MANUALLY rebuild every single part from the ground up because there seems to be no way to export UB footprints in the fashion that MS9/10 does for its parts.
    I understand that they are "partition" but it seems the focus is directly on MS functionality and little on the UB but yet they are supposed to be "interlinked". That doesn't seem to be the case here.
    I have not tried to export version 10 databases and try to reimport them because I don't want to have to go through the headache of starting from ground zero..............again
    If you need more help, you can contact me via my email and I can give you a direct line to help clarify or to speed this issue up.
    Thanks
    Chris
    Signature: Looking for a footprint, component, model? Might be here > http://ni.kittmaster.com

  • Create users before import

    Hi members,
    Is there any specific advantage in creating users using a user creation script before performing data pump import, the import dump file will create the users anyway right?
    Thanks for your reply.

    abctoz wrote:
    Hi members,
    Is there any specific advantage in creating users using a user creation script before performing data pump import, the import dump file will create the users anyway right?
    Thanks for your reply.Suppose the user being imported had - in the source database - a default tablespace that doesn't exist in the target database ... ;-)

  • Error while running User Profile Import - Stopped-extension-dll-load

    Hi guys,
    I'm receiving below error message in event viewer while running user profile import for the first time with event ID 6166:
    The management agent "MOSS-" failed on run profile "MOSS_EXPORT_". The run step stopped because a configured extension for this management agent could not be loaded.
    User Action
    Verify that the extension is located in the Extensions directory. If the extension is present, confirm that the version of the .NET framework  that can run the extension is installed on the server and that a supportedRuntimes  entry in the configuration
    files specifies that version. The synchronization  engine will not be able to load an extension that is built with a newer version  of the .NET framework than the version of the .NET runtime it is hosting.
    At the same time , in miisclient "stopped-extension-dll-load" message for MOSS_EXPORT,MOSS_FULLSYNC, MOSS_DELTASYNC. Can any help to let me understand what will be causing this issue?
     Farm version: 14.0.6137.5000

    Hi Sarath,
    For this issue, I recommend verify the things below:
    Check if the connection name of the Synchronization Connections created in User Profile Service Application has more than 55 characters. If yes, please rename the connection with less than or equal to 55 characters.
    Check if the length of the full path to the dll called “Microsoft.Office.Server.UserProfiles.ManagementAgent” is
     greater than 160. If yes, then we can move the extension Microsoft.Office.Server.UserProfiles.ManagementAgent.dll to the folder c:\windows\assembly\GAC_MSIL and then do an IISRESET.
    If above cannot work, please check ULS log for more detailed error message.
    Best regards,
    Victoria Xia
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Memory error after C042 errors on users database

    Hi,
    We recently have memory error messages on the POA and on the Client.
    The error seemed to follow several C042 errors:
    The database function 53 reported error [C042] on user4mn.db
    Error: Memory error. Memory function failure [8101] User:
    I cannot find any process that is accessing the user database at that time (GWcheck, Backup)
    The user also gets a memory error and has to restart the client.
    any ideas?

    On 9/7/2011 2:16 AM, pdjongh wrote:
    >
    > Hi,
    >
    > We recently have memory error messages on the POA and on the Client.
    > The error seemed to follow several C042 errors:
    > -The database function 53 reported error [C042] on user4mn.db
    > Error: Memory error. Memory function failure [8101] User:-
    >
    > I cannot find any process that is accessing the user database at that
    > time (GWcheck, Backup)
    > The user also gets a memory error and has to restart the client.
    >
    > any ideas?
    >
    >
    Have you run a full contents and structure check on the user?

  • How get scott user database schema in oracle 10g express edition

    hi
    plz any on can tell me how to get the scott user database table details into the oracle 10g express edition
    Iam created the user as scott but but i didn't get the table details
    ...plz give me the details correctly.

    You will go into this path C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. You can get scott.sql script yhen you need to run the script like @C:\oraclexe\app\oracle\product\11.2.0\server\rdbms\admin\scott.sql. Otherwise you just copy the below script and save it into one file then run that file using @
    Rem Copyright (c) 1990 by Oracle Corporation
    Rem NAME
    REM    UTLSAMPL.SQL
    Rem  FUNCTION
    Rem  NOTES
    Rem  MODIFIED
    Rem    gdudey       06/28/95 -  Modified for desktop seed database
    Rem    glumpkin   10/21/92 -  Renamed from SQLBLD.SQL
    Rem    blinden   07/27/92 -  Added primary and foreign keys to EMP and DEPT
    Rem    rlim       04/29/91 -          change char to varchar2
    Rem    mmoore       04/08/91 -          use unlimited tablespace priv
    Rem    pritto       04/04/91 -          change SYSDATE to 13-JUL-87
    Rem   Mendels     12/07/90 - bug 30123;add to_date calls so language independent
    Rem
    rem
    rem $Header: utlsampl.sql 7020100.1 94/09/23 22:14:24 cli Generic<base> $ sqlbld.sql
    rem
    SET TERMOUT OFF
    SET ECHO OFF
    rem CONGDON    Invoked in RDBMS at build time.     29-DEC-1988
    rem OATES:     Created: 16-Feb-83
    GRANT CONNECT,RESOURCE,UNLIMITED TABLESPACE TO SCOTT IDENTIFIED BY TIGER;
    ALTER USER SCOTT DEFAULT TABLESPACE USERS;
    ALTER USER SCOTT TEMPORARY TABLESPACE TEMP;
    CONNECT SCOTT/TIGER
    DROP TABLE DEPT;
    CREATE TABLE DEPT
           (DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
        DNAME VARCHAR2(14) ,
        LOC VARCHAR2(13) ) ;
    DROP TABLE EMP;
    CREATE TABLE EMP
           (EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
        ENAME VARCHAR2(10),
        JOB VARCHAR2(9),
        MGR NUMBER(4),
        HIREDATE DATE,
        SAL NUMBER(7,2),
        COMM NUMBER(7,2),
        DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT);
    INSERT INTO DEPT VALUES
        (10,'ACCOUNTING','NEW YORK');
    INSERT INTO DEPT VALUES (20,'RESEARCH','DALLAS');
    INSERT INTO DEPT VALUES
        (30,'SALES','CHICAGO');
    INSERT INTO DEPT VALUES
        (40,'OPERATIONS','BOSTON');
    INSERT INTO EMP VALUES
    (7369,'SMITH','CLERK',7902,to_date('17-12-1980','dd-mm-yyyy'),800,NULL,20);
    INSERT INTO EMP VALUES
    (7499,'ALLEN','SALESMAN',7698,to_date('20-2-1981','dd-mm-yyyy'),1600,300,30);
    INSERT INTO EMP VALUES
    (7521,'WARD','SALESMAN',7698,to_date('22-2-1981','dd-mm-yyyy'),1250,500,30);
    INSERT INTO EMP VALUES
    (7566,'JONES','MANAGER',7839,to_date('2-4-1981','dd-mm-yyyy'),2975,NULL,20);
    INSERT INTO EMP VALUES
    (7654,'MARTIN','SALESMAN',7698,to_date('28-9-1981','dd-mm-yyyy'),1250,1400,30);
    INSERT INTO EMP VALUES
    (7698,'BLAKE','MANAGER',7839,to_date('1-5-1981','dd-mm-yyyy'),2850,NULL,30);
    INSERT INTO EMP VALUES
    (7782,'CLARK','MANAGER',7839,to_date('9-6-1981','dd-mm-yyyy'),2450,NULL,10);
    INSERT INTO EMP VALUES
    (7788,'SCOTT','ANALYST',7566,to_date('13-JUL-87')-85,3000,NULL,20);
    INSERT INTO EMP VALUES
    (7839,'KING','PRESIDENT',NULL,to_date('17-11-1981','dd-mm-yyyy'),5000,NULL,10);
    INSERT INTO EMP VALUES
    (7844,'TURNER','SALESMAN',7698,to_date('8-9-1981','dd-mm-yyyy'),1500,0,30);
    INSERT INTO EMP VALUES
    (7876,'ADAMS','CLERK',7788,to_date('13-JUL-87')-51,1100,NULL,20);
    INSERT INTO EMP VALUES
    (7900,'JAMES','CLERK',7698,to_date('3-12-1981','dd-mm-yyyy'),950,NULL,30);
    INSERT INTO EMP VALUES
    (7902,'FORD','ANALYST',7566,to_date('3-12-1981','dd-mm-yyyy'),3000,NULL,20);
    INSERT INTO EMP VALUES
    (7934,'MILLER','CLERK',7782,to_date('23-1-1982','dd-mm-yyyy'),1300,NULL,10);
    DROP TABLE BONUS;
    CREATE TABLE BONUS
        ENAME VARCHAR2(10)    ,
        JOB VARCHAR2(9)  ,
        SAL NUMBER,
        COMM NUMBER
    DROP TABLE SALGRADE;
    CREATE TABLE SALGRADE
          ( GRADE NUMBER,
        LOSAL NUMBER,
        HISAL NUMBER );
    INSERT INTO SALGRADE VALUES (1,700,1200);
    INSERT INTO SALGRADE VALUES (2,1201,1400);
    INSERT INTO SALGRADE VALUES (3,1401,2000);
    INSERT INTO SALGRADE VALUES (4,2001,3000);
    INSERT INTO SALGRADE VALUES (5,3001,9999);
    COMMIT;
    SET TERMOUT ON
    SET ECHO ON

  • Permission to run SQL Server DTA - dbo access needed --- to the user database, or msdb ?

    Hi All,
           I am remotely working with a developer who wants to run DTA (SQL Server 2008 R2). I gave the AD Group "ALTER TRACE" permission, and also "execute" permission to xp_msver in master db. I also read that
    the user needs to be in dbo group. This is to the user database they wish to use DTA with, correct ? I just want to be sure that dbo to msdb is not needed.
    Thank you,
    Joe Clark
    Joe Clark

    Please see the link bellow
    http://technet.microsoft.com/en-us/library/ms190987(v=sql.105).aspx
    vt
    Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker

  • Using AAD as a user-database

    I'm wondering if it's possible to use Windows Azure Active Directory (WAAD) as a standard "user-database"? Let me explain..
    We currently have a standard, "home-built" user registration system build on top of SQL server, MVC, etc. The users in this database are registered users of the site, and have used email address to register (from various domains, such as gmail.com,
    yahoo.com, live.com, etc.).
    The idea would be to "lift and shift" these user accounts into a WAAD tenant and replace the home-grown system we have. Why you ask? Two primary reasons:
    - Allows us to take advantage of the myriad of authentication methods provided by WAAD (two-factor, etc.)
    - Safer than on-site storage of credentials, which is a business we don't want to be in.
    The key difference here is we're not using any sync'd directory, and are talking about users with domains different than the WAAD root domain. I realize this is very different than the traditional use cases for a "directory", but it really enables
    some powerful scenarios (if possible).
    So, to wrap up - is this possible? Are there alternatives?
    Thanks!!!

    Thanks for the reply, Paul!
    "If you do not want the logins to be in your domain, they can be external - either their own AAD or Microsoft accounts."
    Therein lies the problem - the accounts we're talking about are neither of these. They are not even directory-related accounts. They are traditional web-style registration accounts, using email addresses as usernames from organizations we will never control
    (Google, Yahoo, Twitter, Amazon, etc.). And, by that very nature, these logins are definitely not in our company domain (nor would we want them to be).

  • To list only user databases with the size for a instance in sql server 2005

    Hi,
    I looking for T-SQl to  list only user databases with their size for a instance in sql server 2005

    Try this:
    use [databasename]
    go
    if convert(varchar(20),SERVERPROPERTY('productversion')) like '8%'
    SELECT [name], fileid, filename, [size]/128.0 AS 'Total Size in MB',
    [size]/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Available Space In MB',
    CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Used Space In MB',
    (100-((([size]/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/([size]/128.0))*100)) AS 'percentage Used'
    ,((CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/([size]/128.0))*100 as 'percentage used'
    FROM sysfiles
    else
    SELECT [name], file_id, physical_name, [size]/128.0 AS 'Total Size in MB',
    [size]/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Available Space In MB',
    CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Used Space In MB',
    (100-((([size]/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/([size]/128.0))*100)) AS 'percentage Used'
    --,((CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0)/([size]/128.0))*100 as 'percentage used'
    FROM sys.database_files
    go
    Or can refer below link:
    http://gallery.technet.microsoft.com/scriptcenter/All-Databases-Data-log-a36da95d
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

Maybe you are looking for