PROC-X.com
An online (unofficial) SAS® journal – written by bloggers

Main menu

Skip to content
  • About
  • add your blog
  • Contact us
SAS

Admins – Need to Restore One Metadata Object from a Backup?

by Tricia Aanderud • March 11, 2013 • Comments Off on Admins – Need to Restore One Metadata Object from a Backup?

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.

When I think of corruption, it usually is more about government.  Certainly, I don’t picture myself slipping a C-Note to the metadata server for favors, such as giving me special access or maybe ensuing my jobs have priority (wink). Stig Eide, a SAS BI administrator, reminds me that corruption does occur in the metadata – but not exactly  what I was picturing.  When metadata corruption occurs, he has found a way to make it easier on himself – mostly by controlling the metadata backup [no kroners required].  Better if I let him explain … 

Get Control of Your Backup

You (or the platform administrator) has probably set up your site’s metadata server backup. In SAS Management Console 9.3, the metadata server does it by default – so that is great!

One problem you will find when you want to restore a backup, is that (by design, of course) it will restore everything to a specific point in time. But, what if the developers have made many changes that they would not like to lose? They only want to restore that one job that got corrupted? This is the most common scenario for restore requests, in my experience. 

Export Changed Objects to Keep It Simple

In order to restore a single metadata object, you can set up a scheduled export of all the changed objects. That way, you can select the objects you want to restore.

SAS has made a tool for this, called the Batch Export and Import Tools. It creates SPK files, the same that you use when promoting content between environments. But, it works from the command line and it is available on all platforms since 9.2.  

For Windows installations, the utility is called ExportPackage.exe. In UNIX installations, the utility is called ExportPackage.sh. Using the command line interface, you can better control what is exported from the metadata.

 The command that I use to export all objects that have changed in the last month is as follows:

"D:\Program Files\SAS\SASPlatformObjectFramework\9.3\ExportPackage.exe" -host metadataserver -port 8561 -user sasadm@saspw -password pwd -objects / -types Job -modified -since "Current day of last month" -package "Jobs.spk" -log "Jobs.log"

You can find the documentation for this command here, but I will describe the parameters that I use:

Parameter

Description

-host

Metadata server host name 

-port

Metadata server port

-user

User that has permissions to read the metadata objects. If you export stored processes and want to include the physical files, you should use a “real” user, not sasadm.

-password

Password of the user

-objects

Top level folder that is exported.  Use a “/” to indicate everything.

-types

Objects that you want to export. You can omit it, or specify a comma separated list, like this:

Job,Cube,InformationMap,Report,ExternalFile,GeneratedTransform,StoredProcess

-modified

Specifies that you want the modified date to be used when evaluating the since criterion

-since

Period you want to export changed objects from.  For example, I use “current day of last month”, which will export the same object many times, creating duplicates. But, it will be easier to find it later.

-package

Name of the SPK file that gets created.

-log

Log file name

If you use this command to schedule the backup, you can be sure that you can restore a single object the next time something gets corrupted.

Restoring a Single Object from the Backup

After you have created your backup package, you are ready to restore an object when a user runs into trouble. Here’s how: 

  1. Log in to SAS Management Console as a user with write permissions to the metadata object.
  2. Right-click on the top-level folder you specified in the Objects parameter in your package and select Import SAS package.

metadata_backup_01

  1. Browse to the SPK file that was created by the backup process.

metadata_backup_02

  1. In the Import SAS Package window, select Clear All and Collapse All. Then select the object you want to import.

metadata_backup_03

  1. Complete the import and your issue is resolved.

Author Information

Stig Eide

 

Stig Eide works for KLP insurance as a platform administrator. He has many years of experience with SAS EBI and DI from an administrators perspective. He holds the highest possible “Certified Platform Administrator for SAS 9″, Level 4. In addition, he considers himself an expert in BASE coding ;)

 

  • SAS Administration: Change the Options to Get More Performance

  • Update Table Metadata Using Base SAS Code

  • SAS Administration: Fetch Big Data Faster Across ODBC

 

The post Admins – Need to Restore One Metadata Object from a Backup? appeared first on Business Intelligence Notes for SAS® BI Users. Written by Tricia Aanderud.

This post was kindly contributed by Business Intelligence Notes for SAS® BI Users - go there to comment and to read the full post.

Tags: BI Admin Metadata SAS Management Console

Post navigation

← Coding in the fast lane with data-driven macro calls
SAS Snippet: Reshape Data Using SAS DoW Loop (From Long to Wide) →

Popular Posts

  • SAS – Lowercase (lowcase) / Uppercase (upcase) / Proper Case (propcase)
  • How do I export from SAS to Excel files: Let me count the ways
  • How to Get Row Numbers in SAS Proc SQL (and DO NOT Use the Undocumented MONOTONIC Function)
  • How to convert the datetime character string to SAS datetime value? (ANYDTDTM and MDYAMPM formats)
  • Using SAS Enterprise Guide to run programs in batch
  • Clear the Results viewer in SAS 9.3

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com

Contributors

  • AFHood Group Blog » SAS
  • Avocet Solutions
  • BI Notes
  • Blogging about all things SAS
  • BusinessKen
  • Computing from Out in Left Field
  • Data Steps
  • Enterprise Software Doesn’t Have to Suck
  • Gregor Gorjanc (gg)
  • Heuristic Andrew
  • Jared Prins’ Blog – SAS
  • Ken's SAS tricks
  • Michael @ Scorpio
  • Musings From an Outlier: The SAS Users Blog
  • NOTE: Development With SAS
  • Numbermonger » SAS
  • Peer Revue
  • Peter Flom blog (Statistical Analysis Consulting)
  • platformadmin.com
  • ProcRun;
  • SAS – BioStatMatt
  • SAS – Confounded by Confounding
  • SAS – From a Logical Point of View
  • SAS & Statistics
  • SAS | r4stats.com
  • SAS and R
  • SAS Learning Post
  • SAS Live!
  • Sas on Melinda Higgins, Ph.D
  • SAS Programming for Data Mining
  • SAS support site – SAS Users
  • SAS Users
  • SAS-BI Business Layers
  • SASopedia
  • SASTechies
  • Software & Service
  • Statistical Analysis Consulting
  • StudySAS Blog
  • The SAS Dummy

Recent Posts

  • Automatic cloning of SAS metadata user groups and roles
  • What is SAS Viya?
  • Understanding the _TYPE_ variable in output data sets
  • New certification alert: SAS® Certified Specialist: Administration of SAS® Viya®
  • SAS training: 5 free sessions technologists love
  • Creating a Microsoft Excel report using SAS, Python and SQL!
  • Decode your SAS® macro code with the MFILE and MPRINT options
  • ESM and S9CA: Useful Tools for Migration from SAS 9 to SAS Viya
  • CAS-Action! Advanced Frequency Tables – Part 4
  • CAS-Action! Grouping Frequency Tables – Part 3
  • Using SAS to score a test
  • CAS-Action! Saving Frequency Tables – Part 2
  • CAS-Action! Simple Frequency Tables – Part 1
  • CAS-Action! Rename Columns in a CAS Table
  • Details, details: Updates to The Little SAS Book

Copyright © 2023 PROC-X.com. All Rights Reserved. The Magazine Basic Theme by bavotasan.com.